package io;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * 使用转换流测试字符流基础的读取字符操作
 */
public class ISRDemo {
    public static void main(String[] args) throws IOException {
        // 将osw.txt的内容全部读取出来
        FileInputStream fis = new FileInputStream("./src/main/java/io/osw.txt");

        // 创建转换输入流
        InputStreamReader isr = new InputStreamReader(fis);

        int d = isr.read();
        while (d != -1) {
            System.out.print((char) d);
            d = isr.read();
        }

        isr.close();

    }
}
